package org.put.netbeans.dcs_modeler.palette;

import org.openide.nodes.Children;
import org.openide.nodes.Node;

public class CategoryChildren extends Children.Keys
{

    private String[] Categories = new String[]{
        "Tools", "Workflow"
    };

    public CategoryChildren()
    {
    }

    protected Node[] createNodes( Object key )
    {
        Category obj = ( Category ) key;
        return new Node[]{ new CategoryNode( obj ) };
    }

    @Override
    protected void addNotify()
    {
        super.addNotify();
        Category[] objs = new Category[ Categories.length ];
        for ( int i = 0; i < objs.length; i++ )
        {
            Category cat = new Category();
            cat.setName( Categories[i] );
            objs[i] = cat;
        }
        setKeys( objs );
    }
}
